home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10775 < prev    next >
Encoding:
Text File  |  1996-08-05  |  910 b   |  29 lines

  1. Newsgroups: comp.lang.c
  2. Path: larry.inf.net!larry
  3. From: Lawrence O'Leary <larry@larry.inf.net>
  4. Subject: array of struct
  5. Message-ID: <Pine.LNX.3.91.960319173746.16221A-100000@larry.inf.net>
  6. Date: Tue, 19 Mar 1996 17:46:08 -0600
  7. MIME-Version: 1.0
  8. Content-Type: TEXT/PLAIN; charset=US-ASCII
  9.  
  10.  
  11. I have a question... though it is petty it bothers me greatly.  :(
  12.  
  13. How would I create a runtime defined array of struct.
  14.  
  15. What I want to do is create each record in the array by reading a line 
  16. from a file and storing each field of the line into the record.  Do this 
  17. for every line in the file and then where done.  What I need to do is 
  18. create the array of the struct for the exact number of lines that are in 
  19. the file.  This way I won't be wasting memory and I won't have to worry 
  20. about not having enough records to store the lines into.
  21.  
  22. You follow?  <G>
  23.  
  24. Thanks in advance.
  25.  
  26. larry@larry.inf.net
  27. larry@izone.net
  28.  
  29.